package com.mz.ozy.activity.other;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.mz.ozy.R;
import com.mz.ozy.base.BaseActivity;
import com.mz.ozy.bean.GameBean;
import com.mz.ozy.mvp.presenter.GamePresenter;
import com.mz.ozy.mvp.view.GameContract;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class GameActivity extends BaseActivity<GameContract.View, GamePresenter> implements GameContract.View {

    private String gameCode;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_game);
        ButterKnife.bind(this);
        initTitle();
        setTitleBarMargin();
        tvBack.setVisibility(View.GONE);
        tvTitle.setVisibility(View.GONE);
        tvCenterTitle.setText(getString(R.string.game_title));
    }

    @OnClick({R.id.iv_game})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_game:
                mPresenter.geAssetsInfo(this, true);
                break;
        }
    }

    @Override
    public void geAssetsInfoSuccess(GameBean bean) {
        gameCode = bean.getCode();
        Intent intent = new Intent(this, GameDetailActivity.class);
        intent.putExtra("code", gameCode);
        startActivity(intent);
    }

}
